﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MagnOS.Command
{
    class Shell
    {
        VersionControl ShellVersion_ = new VersionControl();
        CommandParser Comp_ = new CommandParser();
        public Shell()
        {
            Console.Clear();
            Console.WriteLine("Initializing Shell...\n");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine(ShellVersion_.GetProductName() + " v" + ShellVersion_.GetMajorVersion() + "." + ShellVersion_.GetMinorVersion() + " - Millestone " + ShellVersion_.GetMillestone());
            Console.WriteLine("\nBy " + ShellVersion_.GetDeveloper() + " (" + ShellVersion_.GetYear() + ")\n\n");
            Console.ForegroundColor = ConsoleColor.Gray;
        }

        public string[] GetCommand()
        {
            string[] ProcCommand_ = new string[24];
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("cmd>");
            Console.ForegroundColor = ConsoleColor.Cyan;
            var Command = Console.ReadLine();
            Console.ForegroundColor = ConsoleColor.Gray;

            ProcCommand_ = Command.Split(' ');

            return ProcCommand_;
        }

        public void ProcessCommand(string[] Command)
        {
            Comp_.ParseCommand(Command);
        }
    }
}
